#ifndef SOAPHANDLER_H
#define SOAPHANDLER_H

#include <QtCore>
#include <qtsoap.h>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include "appState.h"
#include "simpleHandler.h"
#include "mainWindow.h"

class LocDepState;

class SoapHandler : public QObject
{
  Q_OBJECT
public:
             explicit  SoapHandler( MainWindow *parent = 0 );

signals:
                 void  zipValid();
                 void  zipInvalid();
                 void  latLonChange( QString );
                 void  updateForecast();
                 void  forecastDone();
                 void  newForecast();
                 void  drawingDone();
                 void  uploadDone();
                 void  getRadarImageDone();
                 void  gotRadarImageDone();

public slots:
                 void  checkZip();
                 void  checkTime();
                 void  zipResponse();
                 void  checkForecast();
                 void  forecastResponse();
                 void  drawBgImg();
                 void  drawImage();
                 void  uploadImage();
                 void  downloadImage();
                 void  getRadarImage();
                 void  gotRadarImage();

public:
              QString  tempRhString();
              QString  getXmlItem( QString tag, QString data );
              QString  getValue( QString tag, QString data );
  QtSoapHttpTransport  zipTx;
  QtSoapHttpTransport  forecastTx;
           MainWindow *mainWin;
          LocDepState *forecastWaiting;
                float  temp ;
                float  maxt ;
                float  dewpt;
                float  tempc;
                float  rh   ;
                float  pprec;
               QImage *image;
               QImage *bgimg;
           QByteArray  radarFileImage;
QNetworkAccessManager *netAccMan;
        QNetworkReply *radarReply;
                 QUrl *ftpSite;
               QTimer  updateTimer;
};

#endif // SOAPHANDLER_H
